/**
  * Menu Theme: dropdown4
  * Theme ID: d4
  * Author: Minwe (minwe@yunshipei.com)
  */

.am-menu-dropdown4 {

  @trigger-color: #fff;
  @trigger-active-color: #F2F3F5;

  @lv2-color: #2A2D32;
  @lv2-bg-color: #F2F3F5;
  @lv2-a-height: 44px;

  @lv3-color: #7E858F;
  @lv3-bg-color: #fff;
  @lv3-a-height: 40px;

  a {
    &::before, &::after {
      .am-icon-font;
    }
  }
  // level 1: trigger bars
  > li.am-parent {
    position: relative;
    > a {
      position: absolute;
      right: 10px;
      top: -36px;
      width: 40px;
      height: 24px;
      overflow: hidden;
      padding: 0;
      text-align: right;
      &::before {
        content: @fa-var-bars;
        color: @trigger-color;
        height: 24px;
        width: 40px;
        font-size: 24px;
      }
    }

    &.am-open {
      & > a {
        &::before {
          color: @trigger-active-color;
        }
      }
      &::before {
        .am-icon-font;
        content: @fa-var-caret-up;
        position: absolute;
        right: 24px;
        font-size: 24px;
        top: -15px;
        color: @lv2-bg-color;
      }
    }
  }

  // hide sub menu
  .am-menu-sub {
    display: none;
  }

  .am-menu-lv2 {
    position: absolute;
    left: 0;
    right: 0;
    background-color: @lv2-bg-color;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    z-index: @z-index-dropdown;
    a {
      height: @lv2-a-height;
      line-height: @lv2-a-height;
      padding: 0;
      text-align: center;
    }
    & > li {

      // parent links
      > a {
        color: @lv2-color;
      }

      &.am-parent {
        > a {
          position: relative;
          &::after {
            content: @fa-var-angle-down;
            margin-left: 5px;
          }
        }

        // active status
        &.am-open {
          > .am-menu-lv3 {
            background-color: @lv3-bg-color;
          }
          > a {
            position: relative;
            &::after {
              content: @fa-var-angle-up;
            }
            &::before {
              position: absolute;
              font-size: 24px;
              top: 100%;
              margin-top: -16px;
              left: 50%;
              margin-left: -12px;
              content: @fa-var-caret-up;
              color: rgba(0, 0, 0, 0.2);
            }
          }
        }
      }
    }
  }

  .am-menu-lv3 {
    position: absolute;
    left: 5px;
    right: 5px;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    a {
      color: @lv3-color;
      height: @lv3-a-height;
      line-height: @lv3-a-height;
      padding: 0;
    }
  }

  .hook-am-menu-dropdown4;


  @media (min-width: @breakpoint-md) {
    & {
      > .am-parent {
        > a {
          display: none;
        }
      }

      .am-menu-sub {
        a {
          padding-left: 1.5rem;
          padding-right: 1.5rem;
        }
      }

      .am-menu-lv2 {
        position: static;
        display: block;
        & > li {
          clear: none;
          width: auto;
        }
      }

      .am-menu-lv3 {
        left: auto;
        right: auto;
        z-index: @z-index-dropdown + 1;
        & > li {
          clear: none;
          width: auto;
        }
      }
    }
  }
}

.hook-am-menu-dropdown4() {}